(function(window, undefined) {
	//填补缺失的origin属性
	if(!window.location.origin) {
		window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
	}

	if(window.Promise) {
		window.wait = ms => new Promise(resolve => setTimeout(resolve, ms));
		window.delay = wait;
	}
	String.formmat = (template, ...rest) => {
		for(let i = 0; i < rest.length; i += 1) {
			template = template.replace('{' + i + '}', rest[i])
		}
		return template;
	}
})(window);